<?php

class CHCAxisLabels extends AbstractHCObject
{
    /**
     * What part of the string the given position is anchored to. Can be one of "left", "center" or "right". In inverted charts, x axis label 
     * 
     * @param String $psString
     * @return void
     */
    public function setAlign($psString)
    {
        if (CSDebug::assertString($psString)) return false;
        if (!in_array($psString, array('left', 'center', 'right'))) return false;
        
        $this->setParam('align', $psString);
    }
    
    
    /**
     * Enable or disable the axis labels. Defaults to true.
     * 
     * @param $pbBool
     */
    public function setEnabled($pbBool=true)
    {
        if (CSDebug::assertBoolean($pbBool)) return false;
        
        $this->setParam('enabled', $pbBool);
    }
    
    
    /**
     * Callback JavaScript function to format the label. The value is given by this.value. Defaults to:
	 *
     *      function() {
     *      	return this.value;
     *      }
     *
     * @param String $psJSFunction
     */
    public function setFormatter($psJSFunction)
    {
        if (CSDebug::assertString($psJSFunction)) return false;
        
        $this->setParam('formatter', $this->tokenize($psJSFunction));
    }
    
    
    /**
     * Rotation of the labels in degrees. Defaults to 0.
     * 
     * @param Float $pnNumber
     */
    public function setRotation($pnNumber)
    {
        if (CSDebug::assertNumber($pnNumber, true)) return false;
        
        $this->setParam('rotation', $pnNumber);
    }
    
    
    /**
     * CSS styles for the label. Defaults to:
     *  
     *  array
     *  (
     *  	color: '#666',
     *  	font: '10px bold "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif'
     *  );
     * 
     * @param $pasArray
     */
    public function setStyle($pasArray)
    {
        if (CSDebug::assertArray($pasArray, true)) return false;
        
        $this->setParam('style', $pasArray);
    }
    
    
    /**
     * The x position offset of the label relative to the tick position on the axis. Defaults to 0.
     * 
     * @param Number $pnNumber
     */
    public function setX($pnNumber)
    {
        if (CSDebug::assertNumber($pnNumber, true)) return false;
        
        $this->setParam('x', $pnNumber);
    }
    
    
    /**
     * The y position offset of the label relative to the tick position on the axis. Defaults to 0.
     * 
     * @param Number $pnNumber
     */
    public function setY($pnNumber)
    {
        if (CSDebug::assertNumber($pnNumber, true)) return false;
        
        $this->setParam('y', $pnNumber);
    }
}

?>